<?php							
		class CUnittype extends database
		{
			var $table = 'cdb_unittype';
			
			
		
			
			public function CUnittypeList ()
			{
				$sql = 'select * from {$this->table} '	;
				$this->setQuery($sql);
				$this->query();
				$arrTemp =  $this->loadAllRow();
				
	
				return $arrTemp; 
			}
			
			public function CUnittypeDetail ($id)
			{
				$sql="select * from $this->table where id='{$id}'";
				$this->setQuery($sql);
				$this->query();
				$arr=$this->loadAllRow();
				
				return $arr[0];
			}
			
			
			
			public function CUnittypeAdd ($id,$label)
			{
				$sql = "INSERT INTO {$this->table} (`id`,`label`)
	VALUES ('{$id}','{$label}');";
				
				$this->setQuery($sql);
				$this->query();	
				
				
			}
			
			public function CUnittypeUpdate ($id,$label)
			{
				$sql = "update $this->table set id ='{$id}',label ='{$label}' where id = '{$id}' ";
			
				$this->setQuery($sql);
				$this->query();
			}
			
			public function CUnittypeDelete($id)
			{
				$sql="Delete from  $this->table where id='{$id}'";
				$this->setQuery($sql);
				$this->query();
			}
			
		}
	
	
	
	?>